Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to MPIPreferences starting with GTL parsing #796

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JBlaschke
Copy link
Contributor

These tests:

  1. Allow Cray compiler wrapper parsing to be emulated on systems that don't have the Cray compiler wrappers by pointing the environment variable JULIA_MPI_CC_OPTS_FILE to a file containing the simulated cc --cray-print-opts=all output.
  2. Add 4 tests:
    a. JULIA_MPI_CC_OPTS_FILE simulates the presence of GTL and checks the generated LocalPreferences.toml
    b. JULIA_MPI_CC_OPTS_FILE simulates the absence of GTL and checks the generated LocalPreferences.toml
    c. test using MPI with a provied LocalPreferences.toml from Perlmutter after module load gpu
    d. test using MPI with a provied LocalPreferences.toml from Perlmutter after module load cpu

You don't need a Perlmutter to run these -- this just tests the settings parsing.

@JBlaschke
Copy link
Contributor Author

After popular demand in #785

@JBlaschke
Copy link
Contributor Author

@vchuravy

Copy link
Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need to hook it up in CI

cray_opts = readchomp(Cmd(["cc", "--cray-print-opts=all"]))
opts_file = get(ENV, "JULIA_MPI_CC_OPTS_FILE", "")
cray_opts = ""
if ! isempty(opts_file)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ! isempty(opts_file)
if !isempty(opts_file)

@@ -0,0 +1,3 @@
using Test, MPI

@test MPI.libmpi == "libmpi_gnu_91.so"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@test MPI.libmpi == "libmpi_gnu_91.so"
@test MPI.libmpi == "libmpi_gnu_91.so"

@test only(MPIPreferences.System.preloads) == "libmpi_gtl_cuda.so"
elseif ARGS[1] == "cpu"
@test isnothing(MPIPreferences.System.preloads)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end

@test success(r)
test_existing_prefs("cpu")
r = run(cmd("test_gtl_preload.jl"; a="cpu"))
@test success(r)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@test success(r)
@test success(r)

Comment on lines +31 to +32
if isfile(local_pref_1) rm(local_pref_1) end
if isfile(local_pref_2) rm(local_pref_2) end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isfile(local_pref_1) rm(local_pref_1) end
if isfile(local_pref_2) rm(local_pref_2) end
rm(local_pref_1; force=true)
rm(local_pref_2; force=true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants